//引入axios
import axios from "@/utils/request.js";

export const userLogin = (data) => {
  return axios({
    method: 'post',
    url: '/login',
    data
  });
}

export const userRegister = (data) => {
  return axios({
    method: 'post',
    url: '/register',
    data
  })
}

export const userDetail = (id) => {
  return axios({
    url: '/user/' + id,
    //使用拦截器传递请求头token数据
    /*  headers: { Authorization: localStorage.getItem('userKey') } */
  });
}

export const userUploader = (id, data) => {
  return axios({
    method: 'post',
    url: "/user_update/" + id,
    data
  });
}

//关注
export const follow = (id) => {
  return axios({
    url: '/user_follows/' + id
  });
}
//取消关注
export const unfollow = (id) => {
  return axios({
    url: '/user_unfollow/' + id
  });
}
//关注列表
export const userfollows = () => {
  return axios({
    url: "/user_follows"
  });
}

//收藏列表
export const userStar = () => {
  return axios({
    url: '/user_star'
  });
}